<?php
	$userID = $_SESSION['userId'];
	

	$con = mysql_connect("localhost", "group5", "group5");
    if(!$con)
    {
		echo "Connection failed!";
        exit;
    }
	
	
	
	mysql_select_db("group5");

		echo "<form name='addRoomForm' method='post' action='roomCreate.php'>Building:     <select id='building' name='building'>
				<option value=''>Select a building</option>";
				
				$buildingQuery = 'select * from BUILDING';
				$buildingResult = mysql_query($buildingQuery, $con);
				
				while ($buildingRow = mysql_fetch_row($buildingResult))
				{
					$buildingId = $buildingRow[0];
					$buildingName = $buildingRow[1];
					$buildingNum = $buildingRow[2];
					echo "<option value='$buildingId'>$buildingNum - $buildingName</option>";
				}
				 echo "</select><br>";
				 
				 echo "Room #: <input name='room' type='text' min = '1'><br>";
				 echo "Capacity: <input name='capacity' type='text' min = '1'><br>";
				 
	
	
	echo "<input type='submit' value = 'Add Room'></form>";
?>
